home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-1.iso
/
games
/
nerak2.zip
/
BARTENDE.SCR
< prev
next >
Wrap
Text File
|
1995-09-24
|
5KB
|
208 lines
!
! Default bartender script..
!
! (c) DC Software, 1989-1995
!
! Pending Enhancements
!
! - This script has no voices. For an example of voices, look at
! MERCHANT.SCR and HEALER.SCR
!
!------------------------------------------------------------------------!
:@TALK ! Talk to the character !
!------------------------------------------------------------------------!
if player.hp = 0 then
writeln( player.name, " is dead!" );
STOP;
endif;
if npc.picture >= 0 then
viewpcx(npc);
endif;
loadtext( npc.text ); ! Get the NPC's text block !
loadvfl( npc.voice ); ! Get the NPC's voice block !
! First, say hello.. !
if NPC.V(0) > 0 then
writeln( "Hello ", player.name, ". What brings you back?" );
else
writeln( "Welcome to ", npc.name, ". How may I help you?" );
voice( "Hello" );
endif;
! NowF, set some variables..
NPC.V(0) = 1; ! From know on, remember we've been here
L(1) = 0; ! No business transactions have taken place
L(4) = npc.value / 5 + 1; ! Standard Tip Amount !
:LOOP
L(3) = select$( "Buy Drink", npc.value,
"Give Tip", L4, ! Can't use X(y) on select !
"Talk", -1 );
ON L(3) GOTO DRINK,TIP,XTALK;
:CSTOP
if L(1) = 0 THEN
writeln( "Hasta la vista, baby." );
else
writeln( "It's been a pleasure doing business with you!" );
endif;
goto XSTOP;
!
! Drink
!
:DRINK
if group.gold < npc.value GOTO BROKE;
dec( group.gold, npc.value );
ON L(1) GOTO DRINK1, DRINK2, DRINK3, DRINK4;
writeln( "No more beer for you.." );
GOTO LOOP;
:DRINK1
writeln( ">Ahhh.. That really hit the spot.." );
inc(L1);
goto LOOP;
:DRINK2
writeln( ">Excellent brew, yes sir.." );
inc(L1);
goto LOOP;
:DRINK3
writeln( ">Glugh, glugh, glugh, hic!" );
inc(L1);
goto LOOP;
:DRINK4
writeln( ">Glugh, glugh, burp! Sorry.." );
inc(L1);
if random(2) then ! 50 % chance of getting sick..
player.poisoned = 1;
writeln( "(You feel sick..)" );
endif;
goto LOOP;
!
! Give TIP
!
:TIP
if group.gold < L(4) GOTO BROKE;
dec( group.gold, L(4) );
ON L(1) GOTO TIP1, TIP2, TIP3, TIP4, TIP5;
:TIP1
writeln( ">Heard any good ones lately?" );
writeln( "(the bartender ignores you..)" );
inc( group.gold, L(4) );
goto LOOP;
:TIP2
writeln( ">It's pretty slow around here.." );
writeln( "It's the weather.. You'll get used to it.." );
goto LOOP;
:TIP3
loadhint; ! Loads a random hint into a string variable !
writeln( S0 );
goto LOOP;
:TIP4
writeln( ">Heard any good.. Hic!.." );
writeln( "You're drunk.. You should leave now." );
goto LOOP;
:TIP5
writeln( ">Hic! 'scuse me.. Hic! Burp!" );
writeln( "No drunks allowed on the premises.." );
goto XSTOP;
:BROKE
writeln( "You don't have enough money!");
goto LOOP;
!
! Conversation
!
:XTALK
on L(1) GOTO TALK1, TALK2, CHAT;
writeln( ">Hic! Hic! Burp! 'Scuse me.. Hic!" );
writeln( "You'd better watch your drinking buddy.." );
goto LOOP;
:TALK1
writeln( "Does this look like a social club?" );
goto LOOP;
:TALK2
writeln( "I'm busy. Ask me again later.." );
goto LOOP;
:CHAT
writeln( "What would you like to talk about?" );
:CHAT1
L(3) = getstr("Name","Beer","Tip","Job","Bye");
if L(3) = -1 then
writeln( "Ok." );
goto LOOP; ! Pressed ESCape !
endif;
! First, see if the keyword typed is in the character's text block !
if dotext( S0 ) then
if L(3) = 4 goto XSTOP;
goto CHAT1;
endif;
! It didn't, so try the predefined ones..
on L(3) goto CNAME, CBEER, CTIP, CJOB, CSTOP;
writeln( "I don't know anything about that.." );
goto CHAT1;
!-----------------------------------------------------------------!
! All STOPs now lead here so the screen can be restored if needed !
!-----------------------------------------------------------------!
:XSTOP
if npc.picture >= 0 then
paint(window); ! Assumes the picture fits in the window !
endif;
stats(-1); ! Refresh Statistics !
STOP;
! Nope, try a 'DEFAULT' line
if not dotext( "DEFAULT" ) then
! didn't have 'default' in the text block, so give standard default !
writeln( "I don't know anything about that!" );
endif;
goto CHAT1;
:CNAME
writeln( "My name is ", NPC.name, "." );
GOTO CHAT1;
:CBEER
writeln( "A beer sells for ", $npc.value, " the pretzels are free." );
GOTO CHAT1;
:CTIP
writeln( "Most people give ", $L4 );
GOTO CHAT1;
:CJOB
writeln( "I sell {beer}!" );
GOTO CHAT1;
! Feel free to expand on this list.. !